define(function (require, exports) {
  exports.ready = function (hashCode, data, cite) {
    yufp.custom.vue({
      el: cite.el,
      data: function () {
        var _self = this;
        return {
          formdata: {},
          urls: {
            index: backend.workflowService + '/api/bench/userTaskPool'
          },
          tableColumns: [
            { label: '项目池名称', prop: 'poolName', resizable: true},
            { label: '项目池ID', prop: 'poolId', resizable: true},
            // { label: '项目池描述', prop: 'poolDesc', resizable: true ,align:'center'},
            { label: '待认领数量', prop: 'num', resizable: true},
            {
              label: '操作',
              width: 100,
              fixed: 'right',
              template: function () {
                return '<template scope="scope">\
                <el-button size="small" type="text" @click="$emit(\'custom-row-op\',scope,\'edit\')">认领</el-button>\
                </template>';
              }
            }
          ],
          baseParams: {
            userId: yufp.session.userCode
          },
          height: yufp.frame.size().height - 103
        };
      },
      methods: {
        customRowOp: function (scope, op) {
          // 当前行号：scope.$index
          // 当前行数据：scope.row
          // 当前列对象：scope.column
          // this.$alert('你现在正在操作：' + op + '当前行ID值为：' + scope.row.flowId, '提示');
          if (op == 'edit') {
            var param = {
              poolName: scope.row.poolName,
              poolId: scope.row.poolId,
              returnBackFuncId: cite.id,
              returnBackRootId: cite.rootId
            };
            yufp.router.to('taskpoolinfo', param, cite.rootId);
          }
        }
      }
    });
  };
});
